package com.zh.note.huawei.onehundred.经典屏保;

/**
 * @Author: zhanghuan
 * @date: 2023/8/19 10:40
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        // Scanner sc = new Scanner(System.in);
        // int x = sc.nextInt();
        // int y = sc.nextInt();
        // int t = sc.nextInt();
        int x = 500;
        int y = 570;
        int t = 10;
        int xDir = 1;//x轴每次移动距离
        int yDir = 1;
        int width = 800;
        int height = 600;
        int xBoundary = width - 50;
        int yBoundary = height - 25;
        for (int i = 0; i < t; i++) {
            x = x + xDir;
            y = y + yDir;
            if (x == 0 || x == xBoundary) {
                xDir *= -1;
            }
            if (y == 0 || y == yBoundary) {
                yDir *= -1;
            }
        }
        System.out.println(x + " " + y);
    }
}
